function register() {
	var zhanghao = $("#zhanghao2").val();
	var mima = $("#mima2").val();
	var mima1 = $("#mima1").val();
	if(zhanghao == "") {
		alert("账号为空，请重新输入!");
	} else if(mima == "") {
		alert("密码为空，请重新输入！");
	} else if(mima1 == "") {
		alert("请输入确认密码!");
	} else if(mima != mima1) {
		alert("两次密码输入不一致,请重新输入!");
	} else {
		var user = {
			"username": zhanghao,
			"password": mima
		};

		var jsonData = JSON.stringify(user);
		$.ajax({
			type: "post",
			url: "/user/register",
			data: jsonData,
			dataType: "json",
			contentType: "application/json;charset=UTF-8",
			success: function (data) {
				if(data.msg == "注册成功") {
					window.location.href =data.view;
				}else{
					alert(data.msg+',用户名'+zhanghao+'已被注册');
				}

			}
		});
	}

}